/*******************************************************************************
 * Licensed Materials - Property of IBM
 * (c) Copyright IBM Corporation 2007. All Rights Reserved.
 * 
 * Note to U.S. Government Users Restricted Rights:
 * Use, duplication or disclosure restricted by GSA ADP Schedule
 * Contract with IBM Corp. 
 *******************************************************************************/
package com.example.jazztalk.rcp.ui.actions;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.dialogs.InputDialog;

import com.ibm.team.repository.common.TeamRepositoryException;

public class CreateJazzTalkMessageAction extends AbstractJazzTalkAction {

	private String _text;

	protected void queryUser() {
		InputDialog dialog = new InputDialog(getShell(), "JazzMail",
				"Enter message", "", null);
		int result = dialog.open();
		if (result == InputDialog.OK) {
			_text = dialog.getValue();
		}
	}

	protected void callService(IProgressMonitor monitor)
			throws TeamRepositoryException {
		if (_text != null) {
			getClientLibrary().createMessage(_text, monitor);
		}
	}
}
